Imatinib or 4-[(4-methyl-1-piperazinyl)methyl]-N-[4-methyl-3-[[4-(3-pyridinyl)-2-pyrimidinyl]amino]phenyl]-benzamide, and in particular Imatinib mesylate of formula (I-MSA), is an important active substance used in the treatment of chronic myeloid leukemia.

Its preparation is described for the first time in EP 564409.
An interesting and economical process for preparing a key intermediate of Imatinib: 4-methyl-N3-[4-(3-pyridinyl)-2-pyrimidinyl]-1,3-benzenediamine of formula (II):
is described in WO2008/059551 of F.I.S.—Fabbrica Italiana Sintetici S.p.A.
EP998473 describes the preparations of the alpha and beta polymorphic form of Imatinib mesylate.
WO2006/024863, US2006/0223816, WO2008/150481 and WO2009/151899 also describe other preparations of polymorphic forms of Imatinib mesylate, of the alpha and beta forms in particular. This literature does not, however, highlight a major problem that cannot be ignored in a pharmaceutical context, which is that of residual solvents. Patents EP2546247 and 1T1406881 B, also of F. I. S., describe a process for preparing the alpha and beta polymorphic form of Imatinib mesylate that allows a product, having residual solvents within the limits laid down by the ICH guideline, to be obtained.
The mutagenicity of the synthesis intermediate having formula (II), 4-methyl-N3-[4(3-pyridinyl)-2-pyrimidinyl]-1,3-benzenediamine, was extensively studied during the development of the synthesis process of Imatinib:
and it was found that it was positive for mutagenesis in that it provides a positive response to the Reverse Mutation Assay test using Salmonella Typhimurium. 
The compound of formula (II) is the last intermediate in the synthesis of Imatinib and it is therefore of fundamental importance to ensure that the content of this residual reagent, a potential genotoxic impurity of Imatinib base and of Imatinib mesylate, is so low as to ensure the safety of the pharmaceutical product containing Imatinib mesylate.
It has been recently observed that at least one Regulatory Authority is considering a limit for this impurity, compound of formula (II) and impurity called impurity F of Imatinib, and this limit would be in the order of parts or of tens per million (ppm).
In the remaining part of the description, the compound of formula (II) can therefore also be called impurity F or aminopyrimidine.
The publication WO2012/015999, in example 1, discloses a process for the preparation of Imatinib by coupling of the compound of formula (II) with 4-((4-methylpiperazin-1-yl)methyl)benzoyl chloride where, during the work-up, Imatinib was transferred from and organic phase consisting of dichloromethane to an aqueous phase at pH 4.5-5.0, said pH being achieved by addition of 20% acetic acid solution. The aqueous phase has been washed three times with dichloromethane and at the end the product has been obtained with 66.8% of molar yield.
In example 9, a similar procedure of example 1 has been repeated, including the three washings of the aqueous phase with dichloromethane, providing Imatinib with molar yield of 64.0%. After recrystallization of the product using Dimethylformamide the product still contains 20 ppm of impurity F.
The main drawbacks of these procedures are the relatively low molar yield of the product, the need of preforming three washings of the aqueous phase, and the final product contains a relatively high amount of impurity F (20 ppm).
The publication WO2008/136010, example 1, discloses a process for the preparation of Imatinib by coupling of the compound of formula (II) with 4-((4-methylpiperazin-1-yl)methyl)benzoyl chloride where, during the work-up, Imatinib was transferred from and organic phase made of chloroform to an aqueous phase at pH 3-4, said pH being achieved by addition of dilute hydrochloric acid. The aqueous phase has been washed three times with chloroform.
WO2012/131711, example 1 and 2, disclose a process for the preparation of Imatinib by coupling of the compound of formula (II) with 4-((4-methylpiperazin-1-yl)methyl)benzoyl chloride where, during the work-up, Imatinib was transferred from and organic phase made of dichloromethane to an aqueous phase at pH 2.5-3.0, said pH being achieved by addition of dilute hydrochloric acid. The aqueous phase has been washed with dichloromethane thus providing Imatinib containing 13.3 or 29 ppm of impurity F. After recrystallization of the product using Methanol the Imatinib contains 2.6 or 9.0 ppm of impurity F it was obtained with a molar yield of 74% or 73%. Nevertheless, to achieve these levels of impurity F, a large excess (>1.5 mol. equivalents) of 4-((4-methylpiperazin-1-yl)methyl)benzoyl chloride have been used to reduce the amount of residual compound of formula (II) (i.e. impurity F) at the end of the coupling reaction.
The procedure disclosed in WO2012/131711 suffers therefore of some drawbacks, such as the need of use a large excess of 4-((4-methylpiperazin-1-yl)methyl)benzoyl chloride, the need of wash the aqueous phase with other dichloromethane, the molar yield is relatively low and the amount of impurity F, before the final crystallization is relatively high.